<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var json1 = '[{name: "刘德华", age: 59, sex: "男"},{name: "张学友", age: 59, sex: "男"}]';
        console.log(eval(json1)); eval('var a = 10;');
        eval('console.log(a);');
        var json2 = "[{name: '刘德华'}, {name: '张学友'}]";
        var jsonObj1 = eval(json2);
        console.log(jsonObj1);
        var json3 = "{name: '刘德华'}";
        var jsonObj2 = eval(json3);
        console.log(jsonObj2);
        var jsonObj3 = eval('(' + json3 + ')');
        console.log(jsonObj3);
        var j6 = '[{"name": "刘德华", "age": 18}]';
        console.log(eval(j6));
        console.log(JSON.parse(j6));
    </script>

</body>

</html>